const route= {
  state:{
    routersdata:[]
  },
  mutations:{
    getroutersdata(state,data){
      console.log(data);
      state.routersdata = data
    }
  },
  actions:{
    async getroutersdata(context,payload){
      let response = await context.dispatch('axios',{
        method:'get',
        url:'/api/sam/web/router_task',
      })
    context.commit('getroutersdata',response.data)
    },
    async addroutersdata(context,payload){
      let response = await context.dispatch('axios',{
        method:'post',
        url:'/api/sam/web/router_task',
        data:{
          payload
        }
      })
    },
    async updataroutersdata(context,payload){
      console.log(payload);
      let response = await context.dispatch('axios',{
        method:'put',
        url:'/api/sam/web/router_task',
        data:{
          payload
        }
      })
    },
    async deleteroutersdata(context,payload){
      let response = await context.dispatch('axios',{
        method:'detele',
        url:'/api/sam/web/router_task',
        data:{
          "id":payload
        }
      })
    }
  },
  getters:{}
}
export default route